﻿@model IEnumerable<Shopping_Cart.Models.ViewModels.ShowOrderViewModel>
@{
    ViewData["Title"] = "ShowOrder";
    int row = 1;
}

<h1>نمایش فاکتور</h1>
<hr />
<table class="table table-bordered" dir="rtl">
    <tr>
        <th>#</th>
        <th>图像</th>
        <th>如</th>
        <th>数</th>
        <th>价格</th>
        <th>复数</th>
        <th></th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>@row</td>
            <td>
                <img style="max-width:150px" class="img-thumbnail" src="/Images/@item.ImageName" />
            </td>
            <td>@item.Title</td>
            <td>@item.Count</td>
            <td>@item.Price</td>
            <td>@item.Sum</td>
            <td>
                <a class="btn btn-sm btn-success" href="/Orders/Command/@item.OrderDetailId?command=up">افزایش</a>
                <a class="btn btn-sm btn-warning" href="/Orders/Command/@item.OrderDetailId?command=down">کاهش</a>
                <a class="btn btn-sm btn-danger" asp-controller="Orders" asp-action="Delete" asp-route-id="@item.OrderDetailId">
                    حذف
                </a>
            </td>
        </tr>
        row++;
    }
    <tr>
        <td colspan="5" class="text-left">总:</td>
        <td colspan="2">
            @Model.Sum(s => s.Sum).ToString("#,0 卢尔")
        </td>
    </tr>
    <tr>
        <td colspan="4" class="text-right"></td>
        <td colspan="3">
            <a asp-action="Payment" class="btn btn-primary btn-block text-white font-weight-bold">最终批准和付款</a>
        </td>
    </tr>
</table>

